<!DOCTYPE html>
<html>
<head>
<title>简易后台管理</title>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="Bootstrap/js/jquery-1.11.1.min.js"></script>
<link href="Bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="Bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function(){
		//初始化商品分类
		var urlSort = "product_findAllSort.htm";
		$.post(urlSort,function(data){
			var html = "<option value='1'>--选择分类--</option>"; 
			for(var i = 0 ;i<data.length;i++){
				html+="<option value='"+data[i].sortId+"'>"+data[i].sortName+"</option>";
			}
			$("[name='productSort.sortId']").html(html);
		});
		//初始化商家信息
		var businessUrl = "product_findAllBusiness.htm";
		$.post(businessUrl,function(data){
			var html = "<option value='1'>--选择商家--</option>"; 
			for(var i = 0 ;i<data.length;i++){
				html+="<option value='"+data[i].businessId+"'>"+data[i].businessName+"</option>";
			}
			$("[name='business.businessId']").html(html);
		});
		//保存
		$(".sub-but").click(function(){
			alert("添加成功！");
		});
	});
</script>
</head>

<body>
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">添加商品</h3>
		</div>
		<form action="product_add.htm" method="post">
		<div class="panel-body">
			<input type="text" class="form-control" name="product.productName" placeholder="请输入商品名" maxlength="15">
			 <br> <select name="productSort.sortId" class="form-control">
				<option value="">--选择分类--</option>
			</select> <br> 
			<input type="number" class="form-control" name="product.oldPrice" placeholder="请输入原价" maxlength="5"> <br>
			<input type="number" class="form-control" name="product.newPrice" placeholder="请输入优惠价" maxlength="5">
		   <br> 
		   
		   <select name="business.businessId" class="form-control">
			</select><br> 
			
			 <div class="form-group">
    			<textarea name="product.productDetails" class="form-control" rows="5" placeholder="输入商品详情"></textarea>
  			</div>
		</div>
		 <button type="submit"  class="btn btn-default sub-but" style="margin-left: 30%;">保存</button>
		<br> <br> </form>
	</div>
	
</body>
</html>
